<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
 <head>
  <title>inputEx - MultiSelectField Usage</title>

<!-- YUI CSS -->
<link rel="stylesheet" type="text/css" href="../lib/yui/reset/reset-min.css">
<link rel="stylesheet" type="text/css" href="../lib/yui/fonts/fonts-min.css">
<link rel="stylesheet" type="text/css" href="../lib/yui/container/assets/container.css"> 
<link rel="stylesheet" type="text/css" href="../lib/yui/assets/skins/sam/skin.css">

<!-- InputEx CSS -->
<link type='text/css' rel='stylesheet' href='../css/inputEx.css' />

<!-- Demo CSS -->
<link rel="stylesheet" type="text/css" href="css/demo.css"/>
<link rel="stylesheet" type="text/css" href="css/dpSyntaxHighlighter.css">

 </head>

 <body>

<p class='demoTitle'>inputEx - MultiSelectField Usage</p>


<!-- Example 1 -->
<div class='exampleDiv'>

	<p class="title">Basic MultiSelectField creation</p>
	
	<p>Use the following code to create a basic inputEx MultiSelectField. The first value of "selectValues" is used as the invite text to select an option.</p>

	<div class='demoContainer' id='container1'></div>

	<div class='codeContainer'>
		<textarea name="code" class="JScript">
			new YAHOO.inputEx.MultiSelectField({
				label: 'Javascript libraries you use', 
				name: 'country', 
				selectValues: ['Choose a library', 'YUI','Dojo','Prototype','Scriptaculous', 'mootools'], 
				parentEl: 'container1', 
				description: 'Select and order your favorite libraries'
			});
		</textarea>
			</div>

</div>

<!-- YUI Library -->
<script type="text/javascript" src="../lib/yui/yahoo/yahoo-min.js"></script> 
<script type="text/javascript" src="../lib/yui/dom/dom-min.js"></script> 
<script type="text/javascript" src="../lib/yui/event/event-min.js"></script>
<script type="text/javascript" src="../lib/yui/dragdrop/dragdrop-min.js"></script>

<!-- Just for the example (not needed by MultiSelectField)-->
<script type="text/javascript" src="../lib/yui/json/json-min.js"></script>

<!-- InputEx -->
<script src="../js/inputex.js"  type='text/javascript'></script>
<script src="../js/Field.js"  type='text/javascript'></script>
<script src="../js/fields/StringField.js"  type='text/javascript'></script>
<script src="../js/fields/SelectField.js"  type='text/javascript'></script>
<script src="../js/widgets/ddlist.js"  type='text/javascript'></script>
<script src="../js/fields/MultiSelectField.js"  type='text/javascript'></script>



<script>

YAHOO.util.Event.addListener(window, 'load', function() {

	// Example 1
	var ms = new YAHOO.inputEx.MultiSelectField({
		label: 'Javascript libraries you use', 
		name: 'country', 
		selectValues: ['Choose a library', 'YUI','Dojo','Prototype','Scriptaculous', 'mootools'], 
		parentEl: 'container1', 
		description: 'Select and order your favorite libraries'
	});
	ms.updatedEvt.subscribe(function(e,params) {
		var value = YAHOO.lang.JSON.stringify(params[0]);
		YAHOO.util.Dom.get('container1').appendChild( YAHOO.inputEx.cn('div',null,null,"Updated at "+(new Date())+" "+value+"<br />") );
	});
	
});

</script>

<script src="js/dpSyntaxHighlighter.js"></script>
<script language="javascript"> 
dp.SyntaxHighlighter.HighlightAll('code');
</script>

 </body>
</html>